package model;

import common.GridCoordinate;

/**
 * @author Colin
 * 
 * Tiles encompass both TrailTiles and BackgroundTiles which
 * make up the map.
 *
 */
public class Tile {
	private GridCoordinate coordinates;
	private boolean hasItem = false;
	private Item item;
	
	public Tile(GridCoordinate coord){
		coordinates = coord;
	}
	
	public Tile(int xCoord, int yCoord){
		this(new GridCoordinate(xCoord,yCoord));
	}
	
	public GridCoordinate getGridCoordinates(){
		return coordinates;
	}
	
	public boolean hasItem(){
		return hasItem;
	}
	
	public void placeItem(Item item){
		hasItem = true;
		this.item = item;
	}
	
	public void removeItem(){
		hasItem = false;
		this.item = null;
	}
	
	public Item getItem() {
		return item;
	}
	
	public int getX(){
		return this.coordinates.getX();
	}
	
	public void setX(int x){
		this.coordinates.setX(x);
	}

	public int getY(){
		return this.coordinates.getY();
	}
	
	public void setY(int y){
		this.coordinates.setY(y);
	}
	
}
